#include "N76E003.h"
#include "Common.h"
#include "Delay.h"
#include "SFR_Macro.h"
#include "Function_define.h"
#include "xpower.h"

#define AP_POWER_OFF  0x00
#define AP_POWER_ON   0x01

static UINT8 g_ap_power_state = AP_POWER_OFF;

bit is_ap_powered(void)
{
    return (g_ap_power_state == AP_POWER_ON);
}

void set_ap_power_off()
{
	P12 = 0;
	g_ap_power_state = AP_POWER_OFF;
}

void set_ap_power_on()
{
	P12 = 1;
	g_ap_power_state = AP_POWER_ON;
}

void notify_key_to_ap(void)
{
    P01 = 0;
    Timer0_Delay1ms(20);
    P01 = 1;
}
